package com.geotmt.billingcenter.modules.statis.service;

import com.geotmt.billingcenter.common.entry.ConsumeStatisEntry;
import com.geotmt.billingcenter.common.vo.consume.ConsumeHisVo;
import com.geotmt.billingcenter.common.vo.consume.ConsumeStatisVo;
import com.geotmt.billingcenter.common.vo.params.ParamsConsume;
import com.geotmt.billingcenter.modules.consume.service.ConsumeService;

import java.util.Date;
import java.util.List;

/**
 * @Description 消耗相关统计
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/27 17:23
 * @Version     v1
 **/
public interface ConsumeStatisService {

    /**
     * 消耗list(最细力度)
     * @param obj
     * @return
     */
    List<ConsumeStatisVo> consumeStatisList(ParamsConsume obj);

    /**
     * 消耗list的总计(最细力度)
     * @param obj
     * @return
     */
    ConsumeStatisVo consumeStatisTotal(ParamsConsume obj);

    /**
     * 消耗历史的量统计
     * @param obj
     * @return
     */
    ConsumeStatisVo hisConsumeStatis(ParamsConsume obj);

    /**
     * 消耗list(用户)
     * @param obj
     * @return
     */
    List<ConsumeStatisVo> consumeStatisCompanyList(ParamsConsume obj);

    /**
     * 删除某天的消耗统计
     * @param dayFlag
     * @return
     */
    int deleteConsumeStatis(String dayFlag);

    /**
     * 删除某段时间的消耗统计
     * @param startDay
     * @param endDay
     * @return
     */
    int deleteConsumeStatis2(String startDay, String endDay);

    /**
     * 更新统计报表中的相关维度id信息
     * @param startDay
     * @param endDay
     * @param id
     * @return
     */
    int updateConsumeStatis(String startDay, String endDay, Integer id);


    /**
     * 更新某天的金额
     * @param cuserId
     * @param interfaceId
     * @param dayFlag
     * @param money
     * @return
     */
    int updateConsumeMoney(Integer cuserId, Integer interfaceId, String dayFlag, Double money);

    /**
     * 更新某天的金额
     * @param cuserId
     * @param interfaceType
     * @param dayFlag
     * @param money
     * @return
     */
    int updateConsumeMoney(Integer cuserId, String interfaceType, String dayFlag, Double money);


    /**
     * 批量插入统计数据
     * @param subConsumeStatisList
     */
    void batchInsertStatis(List<ConsumeStatisEntry> subConsumeStatisList);

    /**
     * 计算统计金额并更新到Mysql统计表中
     * @param consumeService
     * @param entry
     * @param preDay
     * @throws Exception
     */
    void getMoneyAndUpdateConsumeMoney(ConsumeService consumeService, ConsumeStatisEntry entry, Date preDay) throws Exception;

    /**
     * 批量计算统计金额并更新到Mysql统计表中
     * @param consumeService
     * @param consumeStatisList
     * @param preDay
     * @throws Exception
     */
    void getMoneyAndUpdateConsumeMoney(ConsumeService consumeService,List<ConsumeStatisEntry> consumeStatisList, Date preDay) throws Exception;
}
